package com.carstop.model;

import java.sql.Timestamp;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.json.JSONArray;

import com.member.model.MemberVO;

public class CarStopAppJsonHandler {

	
	public CarStopAppJsonHandler() {
		super();
	}

	public JSONArray toJSONArray(List<CarStopDetailVO> carstopdeatilList) {
		ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();
		for (CarStopDetailVO carstopdetail : carstopdeatilList) {
			HashMap map = new HashMap();
			
			String stop_id=carstopdetail.getStop_id();			
			Integer carstop_detail_id=carstopdetail.getCarstopDetailId();
			Timestamp arrival=carstopdetail.getArrival();
			map.put("stop_id", stop_id);	
			map.put("carstop_detail_id", carstop_detail_id);	
			map.put("arrival", arrival);	
			list.add(map);		
			
		}
		JSONArray stopJson = new JSONArray(list);
		return stopJson;
	}

}
